home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / utility / utilcli / binhex.lha / Source / SDI_ASM_STD_protos.h < prev    next >
C/C++ Source or Header  |  1996-11-21  |  4KB  |  102 lines

  1. #ifndef SDI_ASM_STD_PROTOS_H
  2. #define SDI_ASM_STD_PROTOS_H
  3.  
  4. /* Includeheader
  5.  
  6.     Name:        SDI_ASM_STD_protos
  7.     Versionstring:    $VER: SDI_ASM_STD_protos.h 1.9 (18.11.96)
  8.     Author:        SDI
  9.     Distribution:    PD
  10.     Description:    my replacement for standard ANSI functions
  11.  
  12.  1.9   18.11.96 : converted text into english language, changed C++ comments
  13.      to C ones
  14. */
  15.  
  16. /* These are mainly the normal ANSI C functions, but with an ASM interface.
  17. You can replace them by their normal functions supplied with your compiler,
  18. but do not mix them up (one object file standard, the other one SDI).
  19.  
  20. differences:
  21.  toupper and tolower: chars (0x41 to 0x5A) and (0xC0 to 0xDD) are upper
  22.   chars (0x61 to 0x79) and (0xDE to 0xFF) are lower (some more than in ANSI)
  23.  isprint: chars (0x20 to 0x7F) and (0xA0 to 0xFF) are printable
  24.  sprintf: only supports exec/RawDoFmt format strings
  25.  and some I do not remember.
  26. */
  27.  
  28. #include <exec/types.h>
  29.  
  30. #ifdef __MAXON__
  31.   #define __asm
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. BYTE __asm SDI_strnicmp(register __a0 STRPTR,    /* string 1            */
  39.             register __a1 STRPTR,    /* string 2            */
  40.             register __d1 ULONG);    /* highest testlength        */
  41. BYTE __asm SDI_strncmp(    register __a0 STRPTR,    /* string 1            */
  42.             register __a1 STRPTR,    /* string 2            */
  43.             register __d1 ULONG);    /* highest testlength        */
  44. UBYTE __asm SDI_tolower(register __d0 UBYTE);    /* character to convert        */
  45. UBYTE __asm SDI_toupper(register __d0 UBYTE);    /* character to convert        */
  46. ULONG __asm SDI_strlen( register __a0 STRPTR);    /* string            */
  47. ULONG __asm SDI_isprint(register __d0 UBYTE);    /* character to convert        */
  48. ULONG __asm SDI_isdigit(register __d0 UBYTE);    /* character to convert        */
  49. ULONG __asm SDI_isxdigit(register __d0 UBYTE);    /* character to convert        */
  50. ULONG __asm SDI_isalnum(register __d0 UBYTE);    /* character to convert        */
  51. ULONG __asm SDI_isupper(register __d0 UBYTE);    /* character to convert        */
  52. ULONG __asm SDI_strtoul(register __a1 STRPTR,    /* buffer            */
  53.             register __a0 UBYTE **,    /* UBYTE var for error position    */
  54.             register __d2 UBYTE);     /* base                */
  55. ULONG __asm SDI_strtol(    register __a1 STRPTR,    /* buffer            */
  56.             register __a0 UBYTE **,    /* UBYTE var for error position */
  57.             register __d2 UBYTE);     /* base                */
  58. void  __asm SDI_strncpy(register __a1 STRPTR,    /* string 1            */
  59.             register __a0 STRPTR,    /* string 2            */
  60.             register __d1 ULONG);    /* highest copy number        */
  61. void __asm SDI_memset(    register __a1 APTR,    /* buffer            */
  62.             register __d0 UBYTE,    /* fill character        */
  63.             register __d1 ULONG);    /* number of bytes        */
  64. STRPTR __asm SDI_strchr(register __a1 STRPTR,    /* buffer            */
  65.             register __d0 UBYTE);    /* character to scan for    */
  66. void SDI_sprintf(STRPTR, STRPTR, ...);        /* buffer, formatdata, data    */
  67.  
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71.  
  72. #define SDI_stricmp(a,b)    SDI_strnicmp(a,b,~0)
  73. #define SDI_strcmp(a,b)        SDI_strncmp(a,b,~0)
  74. #define SDI_strcpy(a,b)        SDI_strncpy(a,b,~0)
  75.  
  76. /* Set SDI_TO_ANSI if you want to use normal ansi names. Do not include
  77. the ANSI files stdio.h / stdlib.h ... , because this may result in an error */
  78.  
  79. #ifdef SDI_TO_ANSI
  80.   #define strnicmp    SDI_strnicmp
  81.   #define strncmp    SDI_strncmp
  82.   #define stricmp    SDI_stricmp
  83.   #define strcmp    SDI_strcmp
  84.   #define tolower    SDI_tolower
  85.   #define toupper    SDI_toupper
  86.   #define strlen    SDI_strlen
  87.   #define isprint    SDI_isprint
  88.   #define isdigit    SDI_isdigit
  89.   #define isxdigit    SDI_isxdigit
  90.   #define isalnum    SDI_isalnum
  91.   #define strtoul    SDI_strtoul
  92.   #define strtol    SDI_strtol
  93.   #define strncpy    SDI_strncpy
  94.   #define strcpy    SDI_strcpy
  95.   #define strchr    SDI_strchr
  96.   #define memset    SDI_memset
  97.   #define sprintf    SDI_sprintf
  98. /*#define memcpy(a,b,c)    CopyMem(b,a,c) */
  99. #endif
  100.  
  101. #endif /* SDI_ASM_STD_PROTOS_H */
  102.